package com.annoncesautomobile.vue.affichageannonces;

import java.util.ArrayList;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.ViewPager;

import com.annoncesautomobile.R;
import com.annoncesautomobile.vue.SuperActivity;

public class FullScreenPhotosActivity extends SuperActivity {
	
	private FullScreenImageAdapter adapter;
	private ViewPager viewPager;
	private ArrayList<String> photos;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_full_screen_photos);
		
		this.viewPager = (ViewPager) findViewById(R.id.pager);


		Intent intent = getIntent();
		int position = intent.getIntExtra("position", 0);
		this.photos = intent.getStringArrayListExtra("photos");

		this.adapter = new FullScreenImageAdapter(FullScreenPhotosActivity.this, this.photos);

		this.viewPager.setAdapter(this.adapter);

		// displaying selected image first
		this.viewPager.setCurrentItem(position);
	}

}
